<extend name="Base/user"/>


<block name="main">

<div class="container">
    <div class="col-md-6 col-md-offset-3 bg-white login-wrap">
        <h1 class="h4 text-center login-title">注册新账号</h1>
                <form role="form" id="user" target="formAjax" <if condition="$isverify"> verify="1" </if> method="post"  action="__SELF__">
            
            <div class="form-group">
                <label class="required">用户名</label>
                <input type="text" class="form-control" name="username" placeholder="字母、数字等，用户名唯一">
            </div>
           <div class="form-group">
                <label class="required">昵称</label>
                <input type="text" class="form-control" name="nickname" placeholder="网页显示的名字">
            </div>
            <div class="form-group">
                <label class="required">Email</label>
                <input type="email" class="form-control" name="email" placeholder="你的常用邮箱地址">
            </div>
            <div class="form-group">
                <label for="" class="required">密码</label>
                <input type="password" class="form-control" name="password" placeholder="6位~30位">
            </div>
            <div class="form-group">
                <label for="" class="required">确认密码</label>
                <input type="password" class="form-control" name="repassword" placeholder="6位~30位">
            </div>
            <if condition="$isverify">
            <div class="form-group">
                <label><i class="icon icon-picture"></i> 验证码</label>
                <input type="text" class="form-control" id="verify" name="verify" placeholder="请输入下方的验证码" >
                <div class="mt10"><a id="reloadCaptcha" href="javascript:void(0)"><img class="verifyimg reloadverify" alt="点击切换" src="{:U('Home/Home/verify')}" alt="点击更换" title="点击更换" ></a></div>
            </div>
            </if>
            <div class="form-group">
                您将同意并接受<a href="#" target="_blank">《服务条款》</a>
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-primary btn-block btn-lg">注册新用户</button>
            </div>
        </form>
    </div>


    <div class="text-center col-md-12 login-link">
        <a href="{:U('User/login')}">账号登录</a>
        |
        <a href="{:U('Index/index')}">首页</a>
        |
        <a href="{:U('User/mi')}">找回密码</a>
    </div>
</div>
</block>
<block name="script">
<script>
$(function(){
	//刷新验证码
	
    $(".reloadverify").click(function(){
    	changeverify();
     });
   
});
function changeverify(){

	var verifyimg = $(".verifyimg").attr("src");
	 if( verifyimg.indexOf('?')>0){
         $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
     }else{
         $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
     }
}
</script>
</block>